<!DOCTYPE html>
<html>
<head>
	<title>邮件测试</title>
	<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
	<meta charset="utf-8">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
</head>
<body>
	<form id="fm" method="post">
		<input type="hidden" name="name" value="顺利办">
		<input type="hidden" name="phone" value="15377777777">
		<input type="hidden" name="class" value="公司注册">
		<input type="hidden" name="message" value="留言信息">
		<input type="hidden" name="from" value="竞价">
	</form>
	<script type="text/javascript">
		$.ajax({
			url:"http://emaai.com/mail/index.php",
			type:"post",
			data:$("#fm").serialize(),
			dataType:"JSON",
			success: function(res){
				console.log(res);
				alert("邮件发送成功，感谢您的留言");
			},
			error: function(err){
				if(err.status == 200){
					alert("感觉您的留言，稍后我们将与您联系");
				}else{
					console.log("err" , err);
					alert("邮件发送失败");
				}
			}
		})
	</script>
</body>
</html>